	function anyCheck(checks, checkValues) {
		var total = 0;
		var max = 0;
		checkValues.value = "|";
		if(checks==null){
			return null;
		} else { max = checks.length; }
		if(max > 1){
			for (var idx = 0; idx < max; idx++) {
				if (eval("checks[" + idx + "].checked") == true) {
				    total += 1;
				    checkValues.value += idx+"|";
				}
			}
		} else {
			if (eval(checks.checked) == true) {
			    total = 1;
			    checkValues.value += "|0|";
			}
		}
		return total;
	}
	
	function anyCheckValue(checks, checkValues) {
		var total = 0;
		var max = 0;
		checkValues.value = "|";
		if(checks==null){
			return null;
		} else { max = checks.length; }
		if(max > 1){
			for (var idx = 0; idx < max; idx++) {
				if (eval("checks[" + idx + "].checked") == true) {
				    total += 1;
				    checkValues.value += eval("checks[" + idx + "].value")+"|";
				}
			}
		} else {
			if (eval(checks.checked) == true) {
			    total = 1;
			    checkValues.value += "|0|";
			}
		}
		return total;
	}
	
	function anyCampoValue(checks, checkValues) {
		var total = 0;
		var max = 0;
		checkValues.value = "";
		if(checks==null){
			return null;
		} else { max = checks.length; }
		if(max > 1){
			for (var idx = 0; idx < max; idx++) {
			    total += 1;
			    valor = eval("checks[" + idx + "].value");
			    if(valor == "") valor = " ";
			    checkValues.value += valor + "#";
			}
		} else {
		    total = 1;
		    valor = checks.value;
			if(valor == "") valor = " ";
		    checkValues.value += valor + "#";
		}
		return total;
	}
	
	function anySelectValue(checks, checkValues) {
		var total = 0;
		var max = 0;
		checkValues.value = "";
		if(checks==null){
			return null;
		} else { max = checks.length;} //if(max = 'undefined'){max = checks.length;}
		
		if(max > 1){
			for (var idx = 0; idx < max; idx++) {
				try{
					if(eval("checks.options[" + idx + "].selected") != null){
						if(eval("checks.options[" + idx + "].selected") == true){
						    total += 1;
						    checkValues.value += eval("checks[" + idx + "].value") + "#";
					    }
				    }
			    }catch(err){
			        total += 1;
				    checkValues.value += eval("checks[" + idx + "].value") + "#";
			    }
			}
		} else {
		    total = 1;
		    checkValues.value += checks.value + "#";
		}
		return total;
	}
	
	function anyCheckDt(checks) {
		var total = 0;
		var max = 0;
		if(checks==null){
			return null;
		} else { max = checks.length; }
		if(max > 1){
			for (var idx = 0; idx < max; idx++) {
				if (eval("checks[" + idx + "].checked") == true) {
				    total += 1;
				}
			}
		} else {
			if (eval(checks.checked) == true) {
			    total = 1;
			}
		}
		return total;
	}
	
	function valButton(btn) {
	    var cnt = -1;
	    for (var i=btn.length-1; i > -1; i--) {
	        if (btn[i].checked) {cnt = i; i = -1;}
	    }
		//alert("cnt = "+cnt);
	    if (cnt > -1) return btn[cnt].value;
	    else { //return null;
			if(btn.checked == true) return btn.value;
			else return null;
		}
	}
	
	function anyCheckAndTextValue(checks, obj1, obj2, hidValuesObj1, hidValuesObj2, mensaje1, mensaje2) {
		var total = 0;
		var max = 0;
		hidValuesObj1.value = "";
		hidValuesObj2.value = "";
		mensaje1.value = "";
		mensaje2.value = "";
		if(checks==null){
			return null;
		} else { max = checks.length; }
		if(max > 1){
			for (var idx = 0; idx < max; idx++) {
				if (eval("checks[" + idx + "].checked") == true) {
				    total += 1;
				    valor1 = eval("obj1[" + idx + "].value");
				    if(valor1 == "") {valor1 = " "; mensaje1.value += (idx+1)+","; }
				    hidValuesObj1.value += valor1 + "#";
				    valor2 = eval("obj2[" + idx + "].value");
				    if(valor2 == "") {valor2 = " "; mensaje2.value += (idx+1)+","; }
				    hidValuesObj2.value += valor2 + "#";
				}
			}
		}else{
			if (eval(checks.checked) == true) {
			    total = 1;
			    valor1 = obj1.value;
				if(valor1 == "") {valor1 = " "; mensaje1.value += "1 "; }
			    hidValuesObj1.value += valor1 + "#";
			    valor2 = obj2.value;
				if(valor2 == "") {valor2 = " "; mensaje2.value += "1 "; }
			    hidValuesObj2.value += valor2 + "#";
			}
		}
		return total;
	}
	
	/*
	function anySelectAndObservacionValue(selectEstado, observacionEstado) {
		var total = 0;
		var max = 0;
		
		if(selectEstado==null){
			return true;
		} else { max = selectEstado.length;}
		
		alert(max);
		if(max > 1){
			for (var idx = 0; idx < max; idx++) {
				try{
					if(eval("selectEstado.options[" + idx + "].selected") != null){
						if(eval("selectEstado.options[" + idx + "].selected") == true){
						    total += 1;
						    valor = eval("selectEstado[" + idx + "].value");
						    alert("valor = "+valor);
						    if(valor!=8){
						    	if(eval("observacionEstado[" + idx + "].value")=="")
				 					return false;
						    }
					    }
				    }
			    }catch(err){
			        total += 1;
				    valor = eval("selectEstado[" + idx + "].value");
				    alert("valor = "+valor);
				    if(valor!=8){
				    	if(eval("observacionEstado[" + idx + "].value")=="")
		 					return false;
				    }
			    }
			}
		} else {
		    total = 1;
		    valor = selectEstado.value;
		    if(valor!=8){
		    	if(observacionEstado.value=="")
 					return false;
		    }
		}
		return true;
	}
	*/
	
	function anySelectAndObservacionValue(selectEstado, observacionEstado) {
		var total = 0;
		var max = 0;
		
		if(observacionEstado==null){
			return true;
		} else { max = observacionEstado.length;}

		if(max > 1){
			for (var idx = 0; idx < max; idx++) {
				try{
					if(eval("observacionEstado[" + idx + "].value") != null){
						if(eval("value[" + idx + "].value") == ""){
						    total += 1;
						    valor = eval("selectEstado[" + idx + "].value");
						    //alert("valor = "+valor);
						    if(valor!=8){
				 				return false;
						    }
					    }
				    }
			    }catch(err){}
			}
		} else {
		    total = 1;
		    if(observacionEstado.value==""){
			    valor = selectEstado.value;
			    //alert("valor = "+valor);
			    if(valor!=8){
			    	observacionEstado.focus();
 					return false;
			    }
		    }
		}
		return true;
	}